package nthu.web.view;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UploadView extends ResourceView<byte[]>{
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
		
		byte[] m = (byte[]) getModel(request);
		
		response.setContentType("image/jpeg");
		OutputStream out = response.getOutputStream();
		//PrintWriter out =  response.getWriter();
		
		//out.write("Success");
		
		out.write(m);
		/*
		String m = (String)getModel(request);
		
		PrintWriter out = response.getWriter();
		out.write(m);*/
	}
}
